package com.qzsoft.system.modules.sysstation.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.util.Date;

/**
 * @author linhuawei
 * @ClassName SysStationEntity
 * @Description 系统拌和站管理
 * @since 2021-12-06
 */
@Data
@TableName("n_sys_station")
public class SysStationEntity {

    /**
     * 主键
     */
    @TableId(type = IdType.ASSIGN_UUID)
    private String id;

    /**
     * 基地code
     */
    @Pattern(regexp = "^(JD)\\d{2}$")
    @NotBlank(message = "所在基地不能为空！")
    @Length(max = 36, message = "所在基地不可超过{max}位")
    private String baseCode;

    /**
     * 拌和站类型
     */
    @Length(max = 36, message = "拌和站类型不可超过{max}位")
    @TableField(updateStrategy = FieldStrategy.NEVER)
    private String type;

    /**
     * 名称
     */
    @Length(max = 36, message = "拌和站名称不可超过{max}位")
    @TableField(updateStrategy = FieldStrategy.NEVER)
    private String name;

    @Length(max = 30, message = "拌和站编号不可超过{max}位")
    @TableField(updateStrategy = FieldStrategy.NEVER)
    private String code;

    @Length(max = 50, message = "编号不可超过{max}位")
    private String identifier;

    /**
     * 购买时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private Date buyTime;

    /**
     * 投产时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private Date produceTime;

    /**
     * 生产厂家
     */
    @NotBlank(message = "设备厂商不能为空！")
    @Length(max = 200, message = "设备厂商不可超过{max}位")
    private String manufacturer;

    /**
     * 机长
     */
    @Length(max = 32, message = "机长不可超过{max}位")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String captain;

    /**
     * 机长名称
     */
    @Length(max = 11, message = "机长电话不可超过{max}位")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String captainPhone;

    /**
     * 规格型号
     */
    @NotBlank(message = "规格型号不能为空！")
    @Length(max = 20, message = "规格型号不可超过{max}位")
    private String model;

    /**
     * 厂商联系人
     */
    @Length(max = 32, message = "厂商联系人不可超过{max}位")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String service;

    /**
     * 厂商联系方式
     */
    @Length(max = 11, message = "厂商联系电话不可超过{max}位")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String servicePhone;

    /**
     * 备注信息
     */
    @Length(max = 210, message = "备注不可超过{max}位")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String info;

    /**
     * 是否校正设置
     */
    @TableField(updateStrategy = FieldStrategy.NEVER)
    private Integer sensorConfig;

    /**
     * 是否材料设置
     */
    @TableField(updateStrategy = FieldStrategy.NEVER)
    private Integer materialConfig;

    /**
     * 创建者
     */
    @TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NEVER)
    private Long creator;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NEVER)
    private Date createDate;

    /**
     * 修改者
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long updater;

    /**
     * 修改时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateDate;

    @Length(max = 2, message = "是否智慧化改造不可超过{max}位")
    private String isSmart;

    /**
     * 删除标识
     */
    @TableLogic
    @TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NEVER)
    private String deleted;

}
